﻿using System;
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Authorization.Users;
using SingleUserMall.Points;

namespace SingleUserMall.Users.VO
{
    [AutoMapFrom(typeof(UserPoints))]
    public class UserPointsVO : EntityDto<long>
    {
        internal User inFromUser { get; set; }
        internal User inUser { get; set;  }
        /// <summary>
        /// 体验金描述
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 体验金金额
        /// </summary>
        public decimal Points { get; set; }
        /// <summary>
        /// 体验金类型
        /// </summary>
        public UserPointsType Type { get; set; }
        /// <summary>
        /// 体验金类型描述
        /// </summary>
        public string PointTypeDes => Type.GetDescription();
        /// <summary>
        /// 体验金状态 (收入 支出)
        /// </summary>
        public UserPointsStatus Status { get; set; }
        /// <summary>
        /// 体验金状态描述
        /// </summary>
        public string StatusDes => Status.GetDescription();
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
        /// <summary>
        /// 来源用户头像
        /// </summary>
        public string Avatar => inFromUser?.Avatar;
        /// <summary>
        /// 来源用户昵称
        /// </summary>
        public string Name => inFromUser?.Name;
        /// <summary>
        /// 用户头像
        /// </summary>
        public string UserAvatar => inUser?.Avatar;
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string UserName => inUser?.Name;
    }
}
